# Beware that the quotes around the values are mandatory

import os

### Secret key for the Flask application
SECRET_KEY='{{ nuancier_secret_key }}'

### url to the database server:
DB_URL='postgresql://{{ nuancier_db_user }}:{{ nuancier_db_pass }}@{{ nuancier_db_host }}/{{ nuancier_db_name }}'

### The FAS groups in which the admin of nuancier are
### This can either be a single group or multiple, defined between
### parenthesis.
ADMIN_GROUP=('sysadmin-nuancier', 'sysadmin-main')


### Static folder
### The folder containing the css, javascript as well as the pictures
### candidates and the cache of those pictures.
### This directory should be somewhere where apache can access, it's
### proposed in '/var/www/nuancier'
STATIC_FOLDER = '/var/cache/nuancier'

### Pictures folder
### The folder in which are located the pictures of the different elections.
### This folder does not have to be writable by the application but should be
### readable.
### /!\ It should be the full path to this folder
PICTURE_FOLDER = os.path.join(STATIC_FOLDER, 'pictures')

### Cache folder
### The folder in which the application will generate thumbnails of the pictures
### selected for an election.
### This folder *must* be *writable* by the application.
### /!\ It should be the full path to this folder
CACHE_FOLDER = os.path.join(STATIC_FOLDER, 'cache')

### Size of the thumbnails (keeping the ratio)
### In order to reduce the loading page of the election page that might contains
### more than hundreds pictures, the application generates thumbnails of each
### pictures.
### The application will keep the ratio intact and just make sure that either
### length or width of the picture fit the length and width specified below.
THUMB_SIZE = (256, 256)

# This is required to fix login in stg
PREFERRED_URL_SCHEME='https'

# dogpile.cache configuration to work with memcached
NUANCIER_CACHE_BACKEND = 'dogpile.cache.memcached'
NUANCIER_CACHE_KWARGS = {'arguments' : {
        'url': "127.0.0.1:11211",
    }
}
